package com.damai.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.damai.dto.TicketCategoryCountDto;
import com.damai.entity.TicketCategory;
import com.damai.entity.TicketCategoryAggregate;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface TicketCategoryMapper extends BaseMapper<TicketCategory> {
    

    List<TicketCategoryAggregate> selectAggregateList(@Param("programIdList")List<Long> programIdList);
    

    int reduceRemainNumber(@Param("amount")Long amount,
                           @Param("id")Long id,
                           @Param("programId") Long programId);
    

    int increaseRemainNumber(@Param("amount")Long amount,
                           @Param("id")Long id,
                           @Param("programId") Long programId);
    

    int batchUpdateRemainNumber(@Param("ticketCategoryCountDtoList") 
                                List<TicketCategoryCountDto> ticketCategoryCountDtoList,
                                @Param("programId")
                                Long programId);
}
